<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">

function show(){
	var isexist = ${isexist};
	if(isexist == 1){
		alert("该活动已存在");
	}
}

function checkempty(){
	if(document.getElementById("addactivity").value=='')
	{
		alert("请填写");
		return false;
	}
}
</script>
</head>
<body onload="show();">
<table width="100%" height="100%">
<tr>
	<td valign="top">
		<s:if test="%{role==0}">
			<jsp:include page="../readhead.jsp"/>
		</s:if>
		<s:elseif test="%{role==1}">
			<jsp:include page="../writehead.jsp"/>
		</s:elseif>
		<s:elseif test="%{role==2}">
			<jsp:include page="../head.jsp"/>
		</s:elseif>
	</td>
</tr>
</table>
<div id="addact">
	<s:form id="addactivity" action="commitActivityAction" method="post" onsubmit="return checkempty();">
		<s:textfield id="cname" name="cname" label="请输入活动名称"/>
		<s:hidden name="pname" value="%{pname}"></s:hidden>
		<s:submit value=" 提交 "/>
	</s:form>
</div>

</body>
</html>